<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Win32 Fonts</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="index.html" title="Cairo: A Vector Graphics Library">
<link rel="up" href="cairo-fonts.html" title="Fonts">
<link rel="prev" href="cairo-ft-font.html" title="FreeType Fonts">
<link rel="next" href="cairo-quartz-font.html" title="Quartz (CGFont) Fonts">
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="cairo-drawing.html" title="Drawing">
<link rel="chapter" href="cairo-fonts.html" title="Fonts">
<link rel="chapter" href="cairo-surfaces.html" title="Surfaces">
<link rel="chapter" href="cairo-support.html" title="Utilities">
<link rel="index" href="index-all.html" title="Index">
<link rel="index" href="index-1.2.html" title="Index of new symbols in 1.2">
<link rel="index" href="index-1.4.html" title="Index of new symbols in 1.4">
<link rel="index" href="index-1.6.html" title="Index of new symbols in 1.6">
<link rel="index" href="index-1.8.html" title="Index of new symbols in 1.8">
<link rel="appendix" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="cairo-ft-font.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="cairo-fonts.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Cairo: A Vector Graphics Library</th>
<td><a accesskey="n" href="cairo-quartz-font.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#cairo-win32-font.synopsis" class="shortcut">Top</a>
                 | 
                <a href="#cairo-win32-font.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" lang="en">
<a name="cairo-win32-font"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="cairo-win32-font.top_of_page"></a>Win32 Fonts</span></h2>
<p>Win32 Fonts — Font support for Microsoft Windows</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="cairo-win32-font.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#define             <a class="link" href="cairo-win32-font.html#CAIRO-HAS-WIN32-FONT--CAPS" title="CAIRO_HAS_WIN32_FONT">CAIRO_HAS_WIN32_FONT</a>
<a class="link" href="cairo-font-face.html#cairo-font-face-t" title="cairo_font_face_t">cairo_font_face_t</a> * <a class="link" href="cairo-win32-font.html#cairo-win32-font-face-create-for-logfontw" title="cairo_win32_font_face_create_for_logfontw ()">cairo_win32_font_face_create_for_logfontw</a>
                                                        (LOGFONTW *logfont);
<a class="link" href="cairo-font-face.html#cairo-font-face-t" title="cairo_font_face_t">cairo_font_face_t</a> * <a class="link" href="cairo-win32-font.html#cairo-win32-font-face-create-for-hfont" title="cairo_win32_font_face_create_for_hfont ()">cairo_win32_font_face_create_for_hfont</a>
                                                        (HFONT font);
<a class="link" href="cairo-font-face.html#cairo-font-face-t" title="cairo_font_face_t">cairo_font_face_t</a> * <a class="link" href="cairo-win32-font.html#cairo-win32-font-face-create-for-logfontw-hfont" title="cairo_win32_font_face_create_for_logfontw_hfont ()">cairo_win32_font_face_create_for_logfontw_hfont</a>
                                                        (LOGFONTW *logfont,
                                                         HFONT font);
<a class="link" href="cairo-error-status.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a>      <a class="link" href="cairo-win32-font.html#cairo-win32-scaled-font-select-font" title="cairo_win32_scaled_font_select_font ()">cairo_win32_scaled_font_select_font</a> (<a class="link" href="cairo-scaled-font.html#cairo-scaled-font-t" title="cairo_scaled_font_t">cairo_scaled_font_t</a> *scaled_font,
                                                         HDC hdc);
void                <a class="link" href="cairo-win32-font.html#cairo-win32-scaled-font-done-font" title="cairo_win32_scaled_font_done_font ()">cairo_win32_scaled_font_done_font</a>   (<a class="link" href="cairo-scaled-font.html#cairo-scaled-font-t" title="cairo_scaled_font_t">cairo_scaled_font_t</a> *scaled_font);
double              <a class="link" href="cairo-win32-font.html#cairo-win32-scaled-font-get-metrics-factor" title="cairo_win32_scaled_font_get_metrics_factor ()">cairo_win32_scaled_font_get_metrics_factor</a>
                                                        (<a class="link" href="cairo-scaled-font.html#cairo-scaled-font-t" title="cairo_scaled_font_t">cairo_scaled_font_t</a> *scaled_font);
void                <a class="link" href="cairo-win32-font.html#cairo-win32-scaled-font-get-logical-to-device" title="cairo_win32_scaled_font_get_logical_to_device ()">cairo_win32_scaled_font_get_logical_to_device</a>
                                                        (<a class="link" href="cairo-scaled-font.html#cairo-scaled-font-t" title="cairo_scaled_font_t">cairo_scaled_font_t</a> *scaled_font,
                                                         <a class="link" href="cairo-matrix.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *logical_to_device);
void                <a class="link" href="cairo-win32-font.html#cairo-win32-scaled-font-get-device-to-logical" title="cairo_win32_scaled_font_get_device_to_logical ()">cairo_win32_scaled_font_get_device_to_logical</a>
                                                        (<a class="link" href="cairo-scaled-font.html#cairo-scaled-font-t" title="cairo_scaled_font_t">cairo_scaled_font_t</a> *scaled_font,
                                                         <a class="link" href="cairo-matrix.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *device_to_logical);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="cairo-win32-font.description"></a><h2>Description</h2>
<p>
The Microsoft Windows font backend is primarily used to render text on
Microsoft Windows systems.
</p>
</div>
<div class="refsect1" lang="en">
<a name="cairo-win32-font.details"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="CAIRO-HAS-WIN32-FONT--CAPS"></a><h3>CAIRO_HAS_WIN32_FONT</h3>
<pre class="programlisting">#define             CAIRO_HAS_WIN32_FONT</pre>
<p>
Defined if the Microsoft Windows font backend is available.
This macro can be used to conditionally compile backend-specific code.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cairo-win32-font-face-create-for-logfontw"></a><h3>cairo_win32_font_face_create_for_logfontw ()</h3>
<pre class="programlisting"><a class="link" href="cairo-font-face.html#cairo-font-face-t" title="cairo_font_face_t">cairo_font_face_t</a> * cairo_win32_font_face_create_for_logfontw
                                                        (LOGFONTW *logfont);</pre>
<p>
Creates a new font for the Win32 font backend based on a
<span class="type">LOGFONT</span>. This font can then be used with
<a class="link" href="cairo-text.html#cairo-set-font-face" title="cairo_set_font_face ()"><code class="function">cairo_set_font_face()</code></a> or <a class="link" href="cairo-scaled-font.html#cairo-scaled-font-create" title="cairo_scaled_font_create ()"><code class="function">cairo_scaled_font_create()</code></a>.
The <a class="link" href="cairo-scaled-font.html#cairo-scaled-font-t" title="cairo_scaled_font_t"><span class="type">cairo_scaled_font_t</span></a>
returned from <a class="link" href="cairo-scaled-font.html#cairo-scaled-font-create" title="cairo_scaled_font_create ()"><code class="function">cairo_scaled_font_create()</code></a> is also for the Win32 backend
and can be used with functions such as <a class="link" href="cairo-win32-font.html#cairo-win32-scaled-font-select-font" title="cairo_win32_scaled_font_select_font ()"><code class="function">cairo_win32_scaled_font_select_font()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>logfont</code></em> :</span></p></td>
<td> A <span class="type">LOGFONTW</span> structure specifying the font to use.
  The lfHeight, lfWidth, lfOrientation and lfEscapement
  fields of this structure are ignored.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a newly created <a class="link" href="cairo-font-face.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a>. Free with
 <a class="link" href="cairo-font-face.html#cairo-font-face-destroy" title="cairo_font_face_destroy ()"><code class="function">cairo_font_face_destroy()</code></a> when you are done using it.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cairo-win32-font-face-create-for-hfont"></a><h3>cairo_win32_font_face_create_for_hfont ()</h3>
<pre class="programlisting"><a class="link" href="cairo-font-face.html#cairo-font-face-t" title="cairo_font_face_t">cairo_font_face_t</a> * cairo_win32_font_face_create_for_hfont
                                                        (HFONT font);</pre>
<p>
Creates a new font for the Win32 font backend based on a
<span class="type">HFONT</span>. This font can then be used with
<a class="link" href="cairo-text.html#cairo-set-font-face" title="cairo_set_font_face ()"><code class="function">cairo_set_font_face()</code></a> or <a class="link" href="cairo-scaled-font.html#cairo-scaled-font-create" title="cairo_scaled_font_create ()"><code class="function">cairo_scaled_font_create()</code></a>.
The <a class="link" href="cairo-scaled-font.html#cairo-scaled-font-t" title="cairo_scaled_font_t"><span class="type">cairo_scaled_font_t</span></a>
returned from <a class="link" href="cairo-scaled-font.html#cairo-scaled-font-create" title="cairo_scaled_font_create ()"><code class="function">cairo_scaled_font_create()</code></a> is also for the Win32 backend
and can be used with functions such as <a class="link" href="cairo-win32-font.html#cairo-win32-scaled-font-select-font" title="cairo_win32_scaled_font_select_font ()"><code class="function">cairo_win32_scaled_font_select_font()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>font</code></em> :</span></p></td>
<td> An <span class="type">HFONT</span> structure specifying the font to use.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a newly created <a class="link" href="cairo-font-face.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a>. Free with
 <a class="link" href="cairo-font-face.html#cairo-font-face-destroy" title="cairo_font_face_destroy ()"><code class="function">cairo_font_face_destroy()</code></a> when you are done using it.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cairo-win32-font-face-create-for-logfontw-hfont"></a><h3>cairo_win32_font_face_create_for_logfontw_hfont ()</h3>
<pre class="programlisting"><a class="link" href="cairo-font-face.html#cairo-font-face-t" title="cairo_font_face_t">cairo_font_face_t</a> * cairo_win32_font_face_create_for_logfontw_hfont
                                                        (LOGFONTW *logfont,
                                                         HFONT font);</pre>
<p>
Creates a new font for the Win32 font backend based on a
<span class="type">LOGFONT</span>. This font can then be used with
<a class="link" href="cairo-text.html#cairo-set-font-face" title="cairo_set_font_face ()"><code class="function">cairo_set_font_face()</code></a> or <a class="link" href="cairo-scaled-font.html#cairo-scaled-font-create" title="cairo_scaled_font_create ()"><code class="function">cairo_scaled_font_create()</code></a>.
The <a class="link" href="cairo-scaled-font.html#cairo-scaled-font-t" title="cairo_scaled_font_t"><span class="type">cairo_scaled_font_t</span></a>
returned from <a class="link" href="cairo-scaled-font.html#cairo-scaled-font-create" title="cairo_scaled_font_create ()"><code class="function">cairo_scaled_font_create()</code></a> is also for the Win32 backend
and can be used with functions such as <a class="link" href="cairo-win32-font.html#cairo-win32-scaled-font-select-font" title="cairo_win32_scaled_font_select_font ()"><code class="function">cairo_win32_scaled_font_select_font()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>logfont</code></em> :</span></p></td>
<td> A <span class="type">LOGFONTW</span> structure specifying the font to use.
  If hfont is null then the lfHeight, lfWidth, lfOrientation and lfEscapement
  fields of this structure are ignored. Otherwise lfWidth, lfOrientation and
  lfEscapement must be zero.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>font</code></em> :</span></p></td>
<td> An <span class="type">HFONT</span> that can be used when the font matrix is a scale by
  -lfHeight and the CTM is identity.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a newly created <a class="link" href="cairo-font-face.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a>. Free with
 <a class="link" href="cairo-font-face.html#cairo-font-face-destroy" title="cairo_font_face_destroy ()"><code class="function">cairo_font_face_destroy()</code></a> when you are done using it.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cairo-win32-scaled-font-select-font"></a><h3>cairo_win32_scaled_font_select_font ()</h3>
<pre class="programlisting"><a class="link" href="cairo-error-status.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a>      cairo_win32_scaled_font_select_font (<a class="link" href="cairo-scaled-font.html#cairo-scaled-font-t" title="cairo_scaled_font_t">cairo_scaled_font_t</a> *scaled_font,
                                                         HDC hdc);</pre>
<p>
Selects the font into the given device context and changes the
map mode and world transformation of the device context to match
that of the font. This function is intended for use when using
layout APIs such as Uniscribe to do text layout with the
cairo font. After finishing using the device context, you must call
<a class="link" href="cairo-win32-font.html#cairo-win32-scaled-font-done-font" title="cairo_win32_scaled_font_done_font ()"><code class="function">cairo_win32_scaled_font_done_font()</code></a> to release any resources allocated
by this function.
</p>
<p>
See <a class="link" href="cairo-win32-font.html#cairo-win32-scaled-font-get-metrics-factor" title="cairo_win32_scaled_font_get_metrics_factor ()"><code class="function">cairo_win32_scaled_font_get_metrics_factor()</code></a> for converting logical
coordinates from the device context to font space.
</p>
<p>
Normally, calls to <code class="function">SaveDC()</code> and <code class="function">RestoreDC()</code> would be made around
the use of this function to preserve the original graphics state.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>scaled_font</code></em> :</span></p></td>
<td> A <a class="link" href="cairo-scaled-font.html#cairo-scaled-font-t" title="cairo_scaled_font_t"><span class="type">cairo_scaled_font_t</span></a> from the Win32 font backend. Such an
  object can be created with <code class="function">cairo_win32_scaled_font_create_for_logfontw()</code>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hdc</code></em> :</span></p></td>
<td> a device context
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a class="link" href="cairo-error-status.html#CAIRO-STATUS-SUCCESS--CAPS"><code class="literal">CAIRO_STATUS_SUCCESS</code></a> if the operation succeeded.
  otherwise an error such as <a class="link" href="cairo-error-status.html#CAIRO-STATUS-NO-MEMORY--CAPS"><code class="literal">CAIRO_STATUS_NO_MEMORY</code></a> and
  the device context is unchanged.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cairo-win32-scaled-font-done-font"></a><h3>cairo_win32_scaled_font_done_font ()</h3>
<pre class="programlisting">void                cairo_win32_scaled_font_done_font   (<a class="link" href="cairo-scaled-font.html#cairo-scaled-font-t" title="cairo_scaled_font_t">cairo_scaled_font_t</a> *scaled_font);</pre>
<p>
Releases any resources allocated by <a class="link" href="cairo-win32-font.html#cairo-win32-scaled-font-select-font" title="cairo_win32_scaled_font_select_font ()"><code class="function">cairo_win32_scaled_font_select_font()</code></a></p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>scaled_font</code></em> :</span></p></td>
<td> A scaled font from the Win32 font backend.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cairo-win32-scaled-font-get-metrics-factor"></a><h3>cairo_win32_scaled_font_get_metrics_factor ()</h3>
<pre class="programlisting">double              cairo_win32_scaled_font_get_metrics_factor
                                                        (<a class="link" href="cairo-scaled-font.html#cairo-scaled-font-t" title="cairo_scaled_font_t">cairo_scaled_font_t</a> *scaled_font);</pre>
<p>
Gets a scale factor between logical coordinates in the coordinate
space used by <a class="link" href="cairo-win32-font.html#cairo-win32-scaled-font-select-font" title="cairo_win32_scaled_font_select_font ()"><code class="function">cairo_win32_scaled_font_select_font()</code></a> (that is, the
coordinate system used by the Windows functions to return metrics) and
font space coordinates.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>scaled_font</code></em> :</span></p></td>
<td> a scaled font from the Win32 font backend
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> factor to multiply logical units by to get font space
              coordinates.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cairo-win32-scaled-font-get-logical-to-device"></a><h3>cairo_win32_scaled_font_get_logical_to_device ()</h3>
<pre class="programlisting">void                cairo_win32_scaled_font_get_logical_to_device
                                                        (<a class="link" href="cairo-scaled-font.html#cairo-scaled-font-t" title="cairo_scaled_font_t">cairo_scaled_font_t</a> *scaled_font,
                                                         <a class="link" href="cairo-matrix.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *logical_to_device);</pre>
<p>
Gets the transformation mapping the logical space used by <em class="parameter"><code>scaled_font</code></em>
to device space.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>scaled_font</code></em> :</span></p></td>
<td> a scaled font from the Win32 font backend
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>logical_to_device</code></em> :</span></p></td>
<td> matrix to return
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.4</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="cairo-win32-scaled-font-get-device-to-logical"></a><h3>cairo_win32_scaled_font_get_device_to_logical ()</h3>
<pre class="programlisting">void                cairo_win32_scaled_font_get_device_to_logical
                                                        (<a class="link" href="cairo-scaled-font.html#cairo-scaled-font-t" title="cairo_scaled_font_t">cairo_scaled_font_t</a> *scaled_font,
                                                         <a class="link" href="cairo-matrix.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *device_to_logical);</pre>
<p>
Gets the transformation mapping device space to the logical space
used by <em class="parameter"><code>scaled_font</code></em>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>scaled_font</code></em> :</span></p></td>
<td> a scaled font from the Win32 font backend
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>device_to_logical</code></em> :</span></p></td>
<td> matrix to return
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 1.4</p>
</div>
</div>
<div class="refsect1" lang="en">
<a name="cairo-win32-font.see-also"></a><h2>See Also</h2>
<p>
</p>
<div class="itemizedlist"><ul type="disc"><li><a class="link" href="cairo-font-face.html#cairo-font-face-t" title="cairo_font_face_t"><span class="type">cairo_font_face_t</span></a></li></ul></div>
<p>
</p>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.11</div>
</body>
</html>
